// Copyright (C) 2011 nitsuja and contributors
// Copyright (C) 2013 Hourglass-Resurrection team
// Hourglass-Resurrection is licensed under GPL v3.
// Full notice is in COPYING.txt.

#ifndef WINTASEE_H_INCL
#define WINTASEE_H_INCL
//#define GET_X_LPARAM(lp)                        ((int)(short)LOWORD(lp))
//#define GET_Y_LPARAM(lp)                        ((int)(short)HIWORD(lp))

#define DIRECTINPUT_VERSION 0x0800
#include "../shared/input.h"
#include "global.h"
#include "../shared/ipc.h"

void FrameBoundary(void* captureInfo=0, int captureInfoType=CAPTUREINFO_TYPE_NONE);
void MakeWindowWindowed(HWND hwnd, DWORD width, DWORD height);
bool IsWindowFakeFullscreen(HWND hwnd);
bool RedrawScreen();
BOOL tls_IsPrimaryThread();
BOOL tls_IsPrimaryThread2(struct ThreadLocalStuff* pCurTls);

bool VerifyIsTrustedCaller(bool trusted);

bool ShouldSkipDrawing(bool destIsFrontBuffer, bool destIsBackBuffer);


/*struct GameWindowInfo {
	HWND handle;
	WNDPROC wndproc;
	BOOL fakeDisplayValid;
	bool fullScreenGame;
	int screenWidth;
	int screenHeight;
	int gameWindowWidth;
	int gameWindowHeight;
	int originalPositionX;
	int originalPositionY;
	int fakePixelFormatBPP;
	int fakeDisplayRefresh;
	bool usingSDLOrDD; // Should not exist?
	union {
		struct DirectDraw {
			// DirectX / DirectDraw stuff here
		};
		struct OpenGL {
			// OpenGL stuff here
		};
	};
	PALETTEENTRY activePalette [256]; // Where should this go when OGL is cleaned up?

	GameWindowInfo()
	{
		handle = NULL;
		// Start with this:
		screenWidth = 800;
		screenHeight = 600;
	}
};

// This should be somewhere else....
extern GameWindowInfo gwi;*/

bool usingSDLOrDD;
//PALETTEENTRY activePalette [256]; // Where should this go when OGL is cleaned up?

//extern bool inPauseHandler;
extern bool redrawingScreen;
extern bool pauseHandlerSuspendedSound;
extern int framecount;
extern DWORD threadCounter;
extern unsigned char asynckeybit [256];
extern unsigned char synckeybit [256];
extern int framecountModSkipFreq;

extern CurrentInput previnput;
extern CurrentInput curinput;


#include "dettime.h"

#endif
